<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/view/common/includes.jsp" %>
<%@ include file="/WEB-INF/view/inc.jsp" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<script type="text/javascript">
    $(function () {
        $("#left_tree").tree({
            onSelect: function (node) {
               /* $("#orgName").textbox("setValue", node.text);*/
                $("#orgId").val(node.id);
                sy_searchFun();
            }
        });
    });
</script>
<body class="easyui-layout">
<div data-options="region:'west',href:'',split:false" title="组织机构" style="width: 200px;">
    <div style="overflow: auto;padding-top:10px;padding-left: 10px;width: 90%;">
        <div id="left_tree" class="easyui_tree"
             data-options="url:'<%=contextPath%>/sys/organization/commonTreeMore',method:'get',animate:true,checkbox:false,parentField:'parentId'">
        </div>
    </div>
</div>
</div>
<div data-options="region:'center',plain:true" style="overflow: hidden; border:0px;">
    <div class="easyui-layout" data-options="fit : true,border : false">
        <!-- 搜索框 -->
        <div data-options="region:'north',title:'查询条件',border:false" style="height:80px; overflow: hidden">
            <form id="searchForm" class="form">
                <div class="fitem fl">
                    <%--<label>当前机构:</label>--%>
                    <%--<input id="orgName" name="orgName"  type="hidden" class="easyui-textbox" />--%>
                    <input id="orgId" name="orgId" type="hidden"/>
                    <label>用户姓名:</label>
                    <input name="realName" class="easyui-textbox">
                    <label>登录名</label>
                    <input name="userName" class="easyui-textbox">
                </div>
                <div class="fitem searchItem fr">
                    <a class="easyui-linkbutton" iconCls="icon-search" onclick="sy_searchFun()">搜索</a>
                    <a class="easyui-linkbutton" iconCls="icon-reload" onclick="sy_resetFun()">重置</a>
                </div>
            </form>
        </div>
        <div data-options="region:'center',border:false">
            <table id="grid" class="easyui-datagrid"
                   data-options="url:'<%=contextPath%>/sys/user/list',fitColumns:true,singleSelect:true, idField: 'id', rownumbers: true,
                 fit: true, fitColumns: true, pagination: true, striped: true,  sortName: 'createTime',toolbar:'#toolbar'">
                <thead>
                <tr>
                    <th data-options="field:'userName',width:100">登录名</th>
                    <th data-options="field:'realName',width:100">真实姓名</th>
                    <th data-options="field:'sex',dictionary:'sex',formatter:sy_dict,width:50">性别</th>
                    <th data-options="field:'tel',width:100">联系电话</th>
                    <th data-options="field:'email',width:100">邮箱</th>
                    <th data-options="field:'orgId',width:100 ,formatter:sy_other_org">机构</th>
                    <th data-options="field:'status',dictionary:'userStatus',formatter:sy_dict" width="100">用户状态</th>
                    <th data-options="field:'statusDate',width:120">离职时间</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
<!-- 按钮-->
<div id="toolbar" style="display: none;">
    <t:button action="user_add" iconCls="icon-add" buttonName="新增" onclick="sy_addUserFun()"/>
    <t:button action="user_edit" iconCls="icon-edit" buttonName="编辑" onclick=""/>
    <t:button action="user_remove" iconCls="icon-remove" buttonName="删除" onclick=""/>
    <t:button action="user_allocateRole" iconCls="icon-back" buttonName="分配角色" onclick=""/>
</div>
<script type="text/javascript">
    var sy_addUserFun = function () {
        var orgId = $("#orgId").val();
        if (!orgId) {
            orgId = 0;
        }
        sy_addFun(sy.contextPath + '/sys/user/toSaveAndUpdate/' + orgId, '添加用户信息',450)
    }
</script>
</body>
</html>



